<!DOCTYPE html>
<html lang="en">
  <head>
    <meta name="copyright" content=
    "Copyright (c) IBM Corporation and others 2000, 2011. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page.">
    <meta charset="utf-8">
    <link rel="STYLESHEET" href="../book.css" type="text/css">
    <script src="PLUGINS_ROOT/org.eclipse.help/livehelp.js">
</script>
    <title>
      Includes
    </title>

    <style>
/*<![CDATA[*/
    span.c1 {color: blue}
    /*]]>*/
    </style>
  </head>
  <body>
    <h2>
      Includes
    </h2>
    <p>
      Includes are used include parts of other documents into your document.
      The markup specifies the document and element to include, and before the
      document is shown to the user, the include element will be
      <i>replaced</i> with the element referred to.
    </p>

    <p>
      For example, you may wish to show a copyright at the end of each help
      document you provide. You could copy and paste it in each document, but
      if the copyright changes (e.g. the copyright year), you have to modify
      <i>every</i> one of your documents.
    </p>
    <p>
      Instead, you can place the copyright in a separate XHTML file called
      <code>copyright.xhtml</code> and assign it a unique identifier, like
      this:
    </p>
    <pre>

   &lt;p <span class="c1">id="copyright"</span>&gt;
      Copyright 2006 My Company. All rights reserved.
   &lt;/p&gt;
</pre>
    <p>
      Then for each document, simply include the copyright paragraph:
    </p>
    <pre>
   &lt;p&gt;

      This is my document. It should have a copyright at the end.
   &lt;/p&gt;
   <span class=
"c1">&lt;include path="my.plugin.id/path/copyright.xhtml/copyright"/&gt;</span>
</pre>
    <p>
      Before the document is sent to the browser to be displayed, the
      <code>include</code> element will be <i>replaced</i> by the copyright
      paragraph.
    </p>

    <h3>
      Where Can I Use Includes?
    </h3>
    <p>
      See below for a list of the document types in which includes can be used.
      The format of the <code>path</code> element of the include <i>depends on
      the type of document you're including from</i>. As you can see in the
      example above, the format for XHTML help documents is
      <code>"&lt;plugin_id&gt;/&lt;path_to_file&gt;/&lt;element_id&gt;"</code>.
      Refer to the links below for the format for your document type.
    </p>

    <ul>
      <li>
        <a href="ua_intro_xhtml.htm">Welcome/Intro XML/XHTML format</a>
      </li>
      <li>
        <a href="ua_help_content_xhtml.htm#include_format">Help XHTML
        format</a>
      </li>
    </ul>

  </body>
</html>
